package team.yidong.fenda.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import team.yidong.fenda.entity.HospitalActivityImg;

import java.util.List;

/**
 * Created by xuanlong on 2018/3/6.
 */
@Repository
public interface HospitalActivityImgRepository extends JpaRepository<HospitalActivityImg, Integer> {
    @Query("select activityImg.imgPath from HospitalActivityImg activityImg where activityImg.hospitalActivityId=?1 and activityImg.status='use'")
    List<String> findHospitalActivityImgPathByActivityId(Integer activityId);

    @Query("select activityImg from HospitalActivityImg activityImg where activityImg.hospitalActivityId=?1 and activityImg.status='use'")
    List<HospitalActivityImg> findHospitalActivityImgByActivityId(Integer activityId);
}
